<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="icon" href="{:config('web.cdn')}/favicon.ico">
	<title>
		反馈意见_米醋儿
	</title>
	<meta name="keywords" content="用户反馈,反馈意见">
	<meta name="description" content="米醋儿用户反馈中心">
	{include file="public:head" /}
</head>
<body>
{include file="public:header_nav" /}

<div class="layui-container" style="background-color: #fff;>

	<div class="fly-panel fly-panel-user">
		<div class="layui-tab layui-tab-brief" lay-filter="user">
			<ul class="layui-tab-title" id="LAY_mine">
				<li class="layui-this" lay-id="info">反馈意见</li>
			</ul>
			<div class="layui-tab-content" style="padding: 20px 0;">
				<div class="layui-form layui-form-pane layui-tab-item layui-show">
					<form method="post" class="layui-form" style="padding: 50px">
						{if !session("index_user")}
						<ul class="site-doc-bgcolor" style="margin-bottom: 15px;">
							<li class="layui-bg-red" style="padding: 10px;">
								您还未登录，请登录后进行反馈 <a style="color:#4949ea" href="{:url('User/login')}">立即登录</a>
							</li>
						</ul>
						{/if}

						{notempty name='$article'}
						<input type="hidden"  name="id" autocomplete="off" value="{$article.id}" class="layui-input">
						{/notempty}




						<div class="layui-form-item">
							<div class="layui-input-inline artitle">
								<input placeholder="文章标题-可空" type="text"  name="title"  autocomplete="off"
									   value="{notempty name='$article'}{$article.title}{/notempty}"
									   class="layui-input">
							</div>
						</div>

						<div class="layui-form-item layui-form-text">

							<div class="layui-input-block">
								<div id="test-editormd">
									<textarea name="content" placeholder="请填写您需要反馈的信息" id="content" style="width: 90%; min-height: 600px; margin: 0 auto; padding: 15px">{notempty name='$article'}{$article.content}{/notempty}</textarea>
								</div>
							</div>
						</div>

						<!--当发布者为后台管理员时可以操作-->
						<div class="layui-form-item">
							{if !session("index_user")}
							<a class="layui-btn" href="{:url('User/login')}">点我登录</a>
							{else/}
							<button class="layui-btn" key="set-mine" lay-submit lay-filter="info">确认提交</button>
							{/if}
						</div>
					</form>
				</div>
			</div>

		</div>
	</div>
</div>
{include file="public:footer" /}

<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(info)', function(data){
            //layer.msg(JSON.stringify(data.field));
			var url = "{:url('Ifeedback/save')}";
			$.post(url,data.field,function (e) {
				if(e.code == 200){
				    success("成功")
					location.reload()
				}else {
				    error(e.msg);
				}
            })
            return false;
        });
    });
</script>